#!/bin/bash

i=1
variable=img
extn=.png
for file in `ls *.dot` ; do
k=`printf "%04d" $i`
newfile=`echo ${variable}_${k}_${extn}`
neato $file -Tpng -o $newfile
let i=i+1
done

mogrify -format jpg -quality 90 *.png
mencoder mf://*.jpg -mf fps=5:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o output.avi  -ffourcc DX50
